package com.cxrj.zhsq.parkingLotManage.controller;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cxrj.zhsq.parkingLotManage.entity.PropertyParkingRegion;
import com.cxrj.zhsq.parkingLotManage.service.ParkingRegionService;

@RestController
public class ParkingRegionController {
	@Resource
	private ParkingRegionService parkingRegionService;
	
	/**
	 * 查询区域 分页
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("selectParkingRegionByPage")
	public Map<String, Object> selectParkingRegionByPage(HttpServletRequest request,HttpServletResponse response){
		return parkingRegionService.selectParkingRegionByPage(request,response);
	}
	
	/**
	 * 删除区域
	 * @param id
	 * @param request
	 * @return
	 */
	@RequestMapping("deleteParkingRegion")
	public Map<String, Object> deleteParkingRegion(String id,HttpServletRequest request){
		return parkingRegionService.deleteParkingRegion(id,request);
	}
	
	/**
	 * 根据Id查询
	 * @param id
	 * @param request
	 * @return
	 */
	@RequestMapping("selectParkingRegionById")
	public Map<String, Object> selectParkingRegionById(String id,HttpServletRequest request){
		return parkingRegionService.selectParkingRegionById(id,request);
	}
	
	/**
	 * 判断编号是否重复
	 * @param number
	 * @param request
	 * @return
	 */
	@RequestMapping("checkingNumber")
	public Map<String, Object> checkingNumber(String number,HttpServletRequest request){
		return parkingRegionService.checkingNumber(number,request);
	}
	
	/**
	 * 添加
	 * @param parkingRegion
	 * @param request
	 * @return
	 */
	@RequestMapping("insertParkingRegion")
	public Map<String, Object> insertParkingRegion(PropertyParkingRegion parkingRegion,HttpServletRequest request){
		return parkingRegionService.insertParkingRegion(parkingRegion,request);
	}
	
	
	/**
	 * 修改
	 * @param parkingRegion
	 * @param request
	 * @return
	 */
	@RequestMapping("updateParkingRegion")
	public Map<String, Object> updateParkingRegion(PropertyParkingRegion parkingRegion,HttpServletRequest request){
		return parkingRegionService.updateParkingRegion(parkingRegion,request);
	}
	
	/**
	 * 车位租赁图
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("selectParkingChart")
	public Map<String, Object> selecParkingChart(HttpServletRequest request,HttpServletResponse response){
		return parkingRegionService.selectParkingChart(request, response);
	}

}
